@extends('layouts.app')

@section('title')用户列表 @stop

@section('content')
    <div class="tabs">
        <div class="panel panel-default bk-bg-white">
            <div class="panel-heading bk-bg-white">
                <h6><i class="fa fa-file-text"></i>@yield('title')</h6>
            </div>
            <div class="panel-body">

                <form action="">
                    <div class="input-group col-md-4 pull-left">
                        <input type="text" name="condition" class="form-control" placeholder="文章标题">
                        <div class="input-group-btn" style="width: 40%">
                            <button type="submit" class="btn btn-info"><i class="fa fa-search"></i> 搜索</button>
                        </div>
                    </div>

                </form>
                <div class="clearfix bk-margin-5"></div>

                @if(session('result'))
                    <div class="alert alert-success">{{ session('result') }}</div>
                @endif
                @if(count($errors))
                    <div class="alert alert-warning">{{ $errors->first() }}</div>
                @endif
                <table class="table table-bordered table-striped mb-none">
                    <thead>
                    <tr>
                        <th>Id</th>
                        <th>用户名</th>
                        <th>创建时间</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    @forelse ($users as $user)
                        <tr>
                            <td>{{ $user->user_id }}</td>
                            <td>{{ $user->username }}</td>
                            <td>{{ $user->create_time }}</td>
                            <td>
                                <a href="">
                                    <i class="fa fa-edit"></i> 编辑</a> |
                                    <button type="button" data-action=""
                                            class="btn btn-info btn-xs js-action"><i class="fa fa-trash-o"></i> 删除
                                    </button>
                            </td>
                        </tr>
                    @empty
                        <tr>
                            <td colspan="7">暂时没有
                                {{ Request::has('condition') ? '搜索到关于"'.Request::get('condition').'"' : '' }}文章
                            </td>
                        </tr>
                    @endforelse
                    </tbody>
                </table>
                <div class="pull-right">
                    {!! $users->links() !!}
                </div>
            </div>
        </div>
    </div>
@stop

@section('js')
    <script src="{{ asset('js/pages/article.js') }}"></script>
@stop
